<%@page import="com.fractalist.base.core.constants.SystemConstants"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/includes.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<title>修改密码</title>
<link rel="stylesheet" href="${ctx }/css/styles.css" type="text/css" />
<script type="text/javascript" src="${ctx }/js/jquery-1.4.4.min.js"></script>
<script>
	function changePwd() {
		var oldpwd = $("#oldpwd").val();
		var newpwd = $("#newpwd").val();
		var newpwd2 = $("#newpwd2").val();
		if (oldpwd == "") {
			alert("请输入原始密码");
			return;
		}
		if (newpwd == "") {
			alert("请输入新密码");
			return;
		}
		if (newpwd2 == "") {
			alert("请输入确认新密码");
			return;
		}
		if (newpwd != newpwd2) {
			alert("两次输入密码不一致，请重新输入");
			return;
		}
		$.post("${ctx}/manage/modifyPwd.action", {
			oldpwd : oldpwd,
			newpwd : newpwd
		}, function(data) {
			data = eval("(" + data + ")");
			if(data.state != 0){
				alert(data.msg);
			}else{
				alert(data.msg);
				location.href="${ctx}/manager/viewModifyPwd.action";
			}
		})
	}
</script>
</head>
<body style="overflow-y: scroll;">
	<div id="wrapper">
		<div id="content_wrap">
			<div class="tabs_content">
				<div class="active_tab" id="tab1"></div>
				<div id="table_wrapper" style="width: 300px; overflow: auto;">
					<form id="uploadForm" method="post">
						<table class="table" cellpadding="0" cellspacing="0">
							<tr>
								<td>原始密码</td>
								<td><input id="oldpwd" name="oldpwd" type="password" /></td>
							</tr>
							<tr>
								<td>新密码</td>
								<td><input id="newpwd" name="newpwd" type="password" /></td>
							</tr>
							<tr>
								<td>确认新密码</td>
								<td><input id="newpwd2" name="newpwd2" type="password" /></td>
							</tr>
							<tr>
								<td></td>
								<td><input type="button" value="修改密码"
									onclick="changePwd();" /></td>
							</tr>
						</table>
					</form>
				</div>
			</div>
		</div>
	</div>
	</div>
</body>
</html>

